#!/usr/bin/bash
#
# Remove all docker images in the VM which is used to deploy T-One
#

FILE=$(readlink -f "${BASH_SOURCE[0]}")
CDIR=$(dirname "$FILE")
NAME=$(basename "$FILE")
TMPDIR=${TMPDIR:-"/tmp"}

function get_docker_image_ids
{
    typeset ids=$(sudo docker images | awk '{print $3}' | grep -v IMAGE)
    echo "$ids"
}

docker_image_ids=$(get_docker_image_ids)
for image_id in $docker_image_ids; do
    sudo docker rmi $image_id
done
